import store from "./store";
import {addGoodsList} from "./store/slices/goods";

const unSubscribe = store.subscribe(function(){
    console.log("subscribe:store数据状态发生更改后执行",store.getState());
    unSubscribe();// 取消订阅
})
store.dispatch(addGoodsList({goodsName:"梨",goodsPrice:20}));
// const state = store.getState();
store.dispatch(addGoodsList({goodsName:"苹果",goodsPrice:20}));


